package JDBC;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class JDPCUtil {
   private static String url = "jdbc:mysql://localhost:3306/test";
    private static String username = "root";
    private static String password = "123456";
    private static String Driver = "com.mysql.cj.jdbc.Driver";

    public static Connection getConnection() throws Exception{

     Class.forName(Driver);
     Connection conn = DriverManager.getConnection(url,username,password);
     return conn;

    }

    public static Connection createConn() throws SQLException {
        return DriverManager.getConnection(url,"userName","password");
    }

}
